<%--
  Created by IntelliJ IDEA.
  User: 11954
  Date: 2022/3/29
  Time: 15:54
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<!-- 引入jstl标签 -->
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>
<!-- 引入jstl的函数 -->
<%@ taglib uri="http://java.sun.com/jsp/jstl/functions" prefix="fn" %>
<html>
<head>
    <title>管理员登录</title>
    <script src="js/login.js"></script>
    <link rel="stylesheet" href="css/login.css">
    <style>
        .aaa{
            width: 100%;
            height: 100%;
            display: flex;
            align-items: center;
        }
        .inp {
            width: 60px;
        }
        .im{
            margin-left: 15px;
            width: 60px;
            height: 40px;
        }
    </style>
    <script>
        function codechange(img) {
            img.src="code?t="+new Date().getTime();
        }
    </script>
</head>
<body>
<div class="title_div">
    <h1>学员管理系统——管理端</h1>
</div>

<div class="core_div">
    <form action="login" method="post">
        <table>
            <tr>
                <td>用户名:</td>
                <td><input name="username" placeholder="请输入用户名"></td>
            </tr>
            <tr>
                <td>密码:</td>
                <td>
                    <input type="password" name="password" placeholder="请输入密码">
                    <c:if test="${param.status =='1' }">
                        <span class="error">用户名或者密码错误</span>
                    </c:if>
                </td>
            </tr>
            <tr>
                <td>验证码:</td>
                <td>
                    <div class="aaa">
                        <input class="inp" name="incode">
                        <img class="im"  src="code" onclick="codechange(this)"/>

                        <c:if test="${param.status =='3'}">
                            <span class="error">验证码失效！</span>
                        </c:if>
                    </div>
                </td>
            </tr>
            <tr>
                <td colspan="2" style="text-align: center">
                    <div class="but">
<%--                        在表单中button的默认type是submit，提交了表单--%>
                        <button>登录</button>
<%--                        在js文件的第二行跳转--%>
                        <button type="button" onclick="goRegister()">注册</button>
                    </div>
                </td>

            </tr>
        </table>
    </form>
</div>
</body>
</html>
